<div class="layuimini-container">
    <div class="layuimini-main">
        <table id="currentTable" class="layui-table layui-hide"
               data-auth-add="{:auth('user/add')}"
               data-auth-edit="{:auth('user/edit')}"
               data-auth-delete="{:auth('user/delete')}"
               data-auth-removeVip="{:auth('user/removeVip')}"
               data-auth-quanxian="{:auth('user/quanxian')}"
               data-auth-celarAllUserBlackList="{:auth('user/celarAllUserBlackList')}"
               data-auth-removeVipAll="{:auth('user/removeVipAll')}"
               data-auth-celarAllUserBlackListAll="{:auth('user/celarAllUserBlackListAll')}"
               data-auth-tequan="{:auth('user/tequan')}"
               data-auth-orders="{:auth('user/orders')}"
               data-auth-fanorder="{:auth('user/fanorder')}"
               lay-filter="currentTable">
        </table>
    </div>
</div>

<script>
    window.onload = function () {
                layui.use(['jquery', 'table', 'layer'], function () {
                    let $ = layui.jquery, table = layui.table, layer = layui.layer;
                    $('.layuimini-main').on('click', 'button[data-click]', function (a) {
                        let event = $(this).data('click');
                        let row = $(this).data('row');
                        let tabId = $(this).data('tableid');
                        if ('forecrefund' === event) {
                            let data = table.checkStatus('currentTableRenderId');
                            let ids = '';
                            for (let i in data.data) {
                                ids += data.data[i].id + ',';
                            }
                            if (!data.data.length) {
                                return layer.msg('请选择要操作的订单', {icon: 5, anim: 6});
                            }
                            layer.open({
                                title: '批量强制退款',
                                type: 2,
                                content: "{:url('order.order/forec_refund')}?ids=" + ids,
                                area: ['60%', '96%'],
                                closeBtn: 1,
                            });
                        }
                    });
                });
            };
    </script>